Skip to content

Fix infinite loop when nest selection runs non-interactively#7

Open
tylerthecoder wants to merge 2 commits intomainfrom
fix-non-interactive-nest-selection
Open

Fix infinite loop when nest selection runs non-interactively#7
tylerthecoder wants to merge 2 commits intomainfrom
fix-non-interactive-nest-selection

Conversation

@tylerthecoder
Copy link
Owner

@tylerthecoder tylerthecoder commented Feb 1, 2026

Summary

  • Fixes the "Invalid selection" spam when running the quick start curl command on a new machine
  • The setup script now redirects stdin from /dev/tty to allow interactive nest selection even when piped
  • Adds a fallback in Rust that detects non-interactive stdin and exits with a helpful message

Problem

When running:

curl https://raw.githubusercontent.com/tylerthecoder/owl/main/setups/owl/setup.sh | bash

The script calls owl nest all at the end. On a fresh machine with no nest configured, this triggers interactive nest selection. But since stdin is consumed by the curl pipe, read_line returns empty strings repeatedly, causing an infinite loop of "Invalid selection" messages.

Solution

  1. Primary fix: setup.sh now runs owl nest all < /dev/tty which redirects stdin from the terminal device, bypassing the curl pipe
  2. Fallback: If stdin still isn't a terminal (e.g., headless environment), Rust detects this and exits gracefully with instructions

Test plan

  • Run curl ... | bash on a fresh machine - should prompt for nest selection interactively
  • Build succeeds

🤖 Generated with Claude Code

tylerthecoder and others added 2 commits February 1, 2026 09:42
When running `owl nest all` via curl pipe (e.g., the quick start
command), stdin is not a terminal. The nest selection loop would
read empty strings from EOF repeatedly, causing "Invalid selection"
to spam forever.

Now detects non-interactive stdin and exits with a helpful message
directing users to run `owl nest switch` manually.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The setup.sh script now redirects stdin from /dev/tty when calling
`owl nest all`, allowing interactive nest selection even when the
script is piped from curl.

Also improves the Rust fallback error message to show the /dev/tty
workaround.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

if !std::io::stdin().is_terminal() {
eprintln!(
"{}",
"No nest configured and stdin is not interactive.".red()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error message incorrectly claims no nest is configured

Low Severity

The error message "No nest configured and stdin is not interactive" is misleading when switch_nest() is called via owl nest switch with an existing nest configured. In this case, get_nest() succeeds (returning the current nest), then switch_nest() is called explicitly for switching. The TTY check fails, but the message incorrectly states "No nest configured" when a nest actually is configured. The message text doesn't accurately reflect all code paths that can trigger it.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant